/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.bus.entity;

import com.thinkgem.jeesite.common.utils.EnumProperty;
import com.thinkgem.jeesite.modules.sys.entity.Dict;
import com.thinkgem.jeesite.modules.sys.entity.User;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.thinkgem.jeesite.common.persistence.DataEntity;

/**
 * 养殖企业信息Entity
 * @author mengying
 * @version 2019-05-30
 */
public class Audit extends DataEntity<Audit> {
	
	private static final long serialVersionUID = 1L;
	private String tableId;		// 所属单位ID
	private String entHistoryId;		// 企业历史表id
	private String tableName;		// 所属单位ID
	private Date auditDate;		// 审核时间
	private String auditOpinion;		// 审核意见
	private String auditStatus;		// 审核状态（0:未审核;1:通过;2驳回）
	private int noticeStatus;		// 审核状态（0:未读;1:已读）
	private String sort;		// 排序
	private String status;		// 启用状态 0=不可用 1=可用
	private Date submitDate;//备案审核提交时间
	private Ent ent;
	private User user;
	private EntDic entDic=new EntDic();
	private Dict dict=new Dict();
	private EntHistory entHistory=new EntHistory();
	private String userId;		// 养殖场用户id

	//辅助字段
	private String noticeAuditDate; //通知模块显示的时间
	private String areaCode;
	private String statusFlag;
	private String auditStatusFlag;


	public Audit() {
		super();
	}

	public Audit(String id){
		super(id);
	}

	public Audit(String id,String tableId, String tableName, String userId,String entHistoryId,boolean isNewRecord) {
		super();
		this.id = id;
		this.tableId = tableId;
		this.tableName = tableName;
		this.userId = userId;
		this.submitDate = new Date();
		this.entHistoryId = entHistoryId;
		this.isNewRecord = isNewRecord;
		this.auditStatus = EnumProperty.AuditTypeEnum.UNREVIEWED.getKey();
		this.noticeStatus = Integer.parseInt(EnumProperty.DataStatus.UNREADNOTICE.getKey());

	}

	@Length(min=0, max=50, message="所属单位ID长度必须介于 0 和 50 之间")
	public String getTableId() {
		return tableId;
	}

	public void setTableId(String tableId) {
		this.tableId = tableId;
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getAuditDate() {
		return auditDate;
	}

	public void setAuditDate(Date auditDate) {
		this.auditDate = auditDate;
	}
	
	@Length(min=0, max=100, message="审核意见长度必须介于 0 和 100 之间")
	public String getAuditOpinion() {
		return auditOpinion;
	}

	public void setAuditOpinion(String auditOpinion) {
		this.auditOpinion = auditOpinion;
	}
	
	@Length(min=0, max=1, message="审核状态（0:未审核;1:通过;2驳回）长度必须介于 0 和 1 之间")
	public String getAuditStatus() {
		return auditStatus;
	}

	public void setAuditStatus(String auditStatus) {
		this.auditStatus = auditStatus;
	}
	
	public int getNoticeStatus() {
		return noticeStatus;
	}

	public void setNoticeStatus(int noticeStatus) {
		this.noticeStatus = noticeStatus;
	}

	@Length(min=0, max=4, message="排序长度必须介于 0 和 4 之间")
	public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}
	
	@Length(min=0, max=1, message="启用状态 0=不可用 1=可用长度必须介于 0 和 1 之间")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Date getSubmitDate() {
		return submitDate;
	}

	public void setSubmitDate(Date submitDate) {
		this.submitDate = submitDate;
	}

	public Ent getEnt() {
		return ent;
	}

	public void setEnt(Ent ent) {
		this.ent = ent;
	}

	public EntDic getEntDic() {
		return entDic;
	}

	public void setEntDic(EntDic entDic) {
		this.entDic = entDic;
	}

	public Dict getDict() {
		return dict;
	}

	public void setDict(Dict dict) {
		this.dict = dict;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}


	public String getNoticeAuditDate() {
		return noticeAuditDate;
	}

	public void setNoticeAuditDate(String noticeAuditDate) {
		this.noticeAuditDate = noticeAuditDate;
	}

	public String getEntHistoryId() {
		return entHistoryId;
	}

	public void setEntHistoryId(String entHistoryId) {
		this.entHistoryId = entHistoryId;
	}

	public EntHistory getEntHistory() {
		return entHistory;
	}

	public void setEntHistory(EntHistory entHistory) {
		this.entHistory = entHistory;
	}

	public final String getAreaCode() {
		return areaCode;
	}

	public final void setAreaCode(String areaCode) {
		this.areaCode = areaCode;
	}

	public final String getStatusFlag() {
		return statusFlag;
	}

	public final void setStatusFlag(String statusFlag) {
		this.statusFlag = statusFlag;
	}

	public String getAuditStatusFlag() {
		return auditStatusFlag;
	}

	public void setAuditStatusFlag(String auditStatusFlag) {
		this.auditStatusFlag = auditStatusFlag;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}
}